Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext


~Samuel Umlupulgon 16.Jan.04 09:22 PM a Web browser
Domino Designer 6.0.3 Windows 2000


I'm trying to put some HTML into every outgoing email my client sends (formatted text and a URL reference to an image on the corporate server).

Thanks to Rod Whitely, I've figured out to get HTML in an outbound email using CreateMIMEEntity. But the code I use to do this tries to create a brand new Body field, which of course results in an error (Item body already exists) when it runs since there's already a Body field on the Memo.

How do I concatenate the new MIME Entity with my existing Body field?

Here's my sample code, in the QuerySave event of my memo:

Sub Querysend(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document

htmltext$ = {My Company<br>
123 My St.<br>
My Town, MyState 12345<br>
Phone: 123-456-7890 Fax: 123-456-7891<br>
Email: me@my_company.com</p>
<a href="http://www.my_company.com"><img
src="http://www.my_company.com/database.nsf/mylogo.jpg?openImageResource"
alt="My Logo" border="0"></a>}

Dim session As New NotesSession

Dim html As NotesStream
Set html = session.CreateStream
html.WriteText htmltext$

Dim mime As NotesMIMEEntity
Set mime = doc.CreateMIMEEntity("Body")
mime.SetContentFromText html, "text/html", ENC_NONE

End Sub

I tried replacing it with this, in which I try to create different rich text and MIME entities and concanetate them, but it doesn't work:

Sub Querysend(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.Document

htmltext$ = {My Company<br>
123 My St.<br>
My Town, MyState 12345<br>
Phone: 123-456-7890 Fax: 123-456-7891<br>
Email: me@my_company.com</p>
<a href="http://www.my_company.com"><img
src="http://www.my_company.com/database.nsf/mylogo.jpg?openImageResource"
alt="My Logo" border="0"></a>}

Dim rtitem1 As Variant
Dim rtitem2 As Variant

Dim session As New NotesSession

Dim html As NotesStream
Set html = session.CreateStream
html.WriteText htmltext$

Dim mime As NotesMIMEEntity
Set mime = doc.CreateMIMEEntity("Body2")
mime.SetContentFromText html, "text/html", ENC_NONE

Set rtitem1 = doc.GetFirstItem( "Body" )
Set rtitem2 = doc.ReplaceItemValue("Body", rtitem1 & Body2 )

End Sub

Thanks very much in advance.






Combining a MIME Entity with a Mail... (~Samuel Umlupul... 16.Jan.04)
. . Any reason for not using Actions, T... (~Dan Elhipister... 16.Jan.04)
. . RE: Combining a MIME Entity with a ... (~Richard Fezkro... 17.Jan.04)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS